#include <iostream>

using namespace std;

int arr[10];

void output(int n) {
  for (int i = 0; i <= n; i++) {
    if (i)
      cout << " ";
    cout << arr[i];
  }
  cout << endl;
  return;
}

void f(int i, int j, int n) {
  // cout << "i = " << i  << " j = " << j << " n = " << n << endl;
  if (j > n) {
    // cout << "return\n" << endl;
    return;
  }
  for (int k = j; k <= n; k++) {
    // cout << "k = " << k << " i = " << i << endl;
    arr[i] = k;
    output(i);
    f(i + 1, k + 1, n);
  }
  return;
}

int main() {
  int n;
  cin >> n;
  f(0, 1, n);
  return 0;
}